package com.nuanshui.heatedloan.userinfo.facade.thirdlogin;

import com.nuanshui.framework.consts.TransactionManagerType;
import com.nuanshui.heatedloan.userinfo.form.BoundUserForm;
import com.nuanshui.heatedloan.userinfo.model.ThirdUser;
import com.nuanshui.heatedloan.userinfo.model.User;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by zxh on 2017/2/10.
 */
/**
 * 三方用户登录操作类
 */
public interface ThirdUserService {

    /**
     * 获取主账号信息
     * @param openId
     * @return
     */
    User loadUser(String openId);

    /**
     * 用户三方账号信息
     * @param userId
     * @return
     */
    ThirdUser loadThirdUser(String userId);

    /**
     * 创建三方账号
     * @param boundUserForm
     * @return
     */
    User insertUser(BoundUserForm boundUserForm);

    /**
     * 三方账号登录验证
     * @param boundUserForm
     * @return
     */
    User authUser(BoundUserForm boundUserForm);


    /**
     * 绑定三方账号
     * @param boundUserForm
     */
    void boundUser(BoundUserForm boundUserForm);

    /**
     * 更新三方账号信息
     * @param userId
     */
    void updateOpenId(String userId);

    /**
     * 解绑定三方账号
     * @param userId
     */
    void unBoundUser(String userId);
}
